package Pattern.FactoryPattern.Car;

/**
 * @Author MJS
 * @Date 2021/8/4 11:40
 * @Description
 */
public class Demo {
    public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
        AbstractFactory abstractFactory = FactoryProducer.getFactory("BMWFactory");
        Car bmw320 = abstractFactory.getCar("BMW320");
        bmw320.drive();

        Car bmw530 = abstractFactory.getCar("BMW530");
        bmw530.drive();

        Car bmw740 = abstractFactory.getCar("BMW740");
        bmw740.drive();

        AbstractFactory abstractFactory1 = FactoryProducer.getFactory("BenzFactory");
        Car benzC200 = abstractFactory1.getCar("BenzC200");
        benzC200.drive();

        Car benzE300 = abstractFactory1.getCar("BenzE300");
        benzE300.drive();
    }
}
